//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package objects;

import common.GlobalID;

import java.util.LinkedHashMap;

public class Tools {
    private static LinkedHashMap<Integer, ToolsEntry> toolsById = new LinkedHashMap();
    private static LinkedHashMap<String, ToolsEntry> toolsByName = new LinkedHashMap();

    public Tools() {
    }

    public static void clear() {
        toolsById.clear();
        toolsByName.clear();
    }

    public static void add(ToolsEntry te) {
        int toolId = GlobalID.create(22, toolsById.size());
        te.setGlobalID(Integer.valueOf(toolId));
        toolsById.put(te.getGlobalID(), te);
        toolsByName.put(te.getName(), te);
    }

    public static ToolsEntry getById(int globalid) {
        return (ToolsEntry)toolsById.get(Integer.valueOf(globalid));
    }

    public static ToolsEntry getByName(String name) {
        return (ToolsEntry)toolsByName.get(name);
    }

    public static LinkedHashMap<Integer, ToolsEntry> getTools() {
        return toolsById;
    }
}
